
global datapath "~/DataFolder"
global Analyses "~/Results"


**************************************************** Table 11: Industry Distress
use "$datapath/RegData.dta", clear

merge 1:1 rssdhcr year fips using "$datapath/Bank_County_IndustryShock.dta"
drop if _merge==2
drop _merge

foreach var of varlist aggIndNegShock_med_30 aggIndNegShock_med_25 aggIndNegShock_med_20 aggIndNegShock_med_15 aggIndNegShock_med_10 aggIndNegShock_med_2side{
replace `var'= 0 if missing(`var')
replace `var'= 1 if `var'>1
}

global controls riskiness male avg_minority branch distance numsbl lretain size loan deposit p_ci p_re roa liquid

tsset bank_county year
gen f2num = f2.num
gen f2volume = f2.volume
gen f2approve_rate_n = f2.approve_rate_n
gen f2approve_rate_v = f2.approve_rate_v

*num
capture drop spec_inddistress
gen spec_inddistress = aggIndNegShock_med_10

reghdfe f2num spec_above5pctemp spec_inddistress $controls ,absorb(county_year bank_state bank_year) cluster(fips)
outreg2 using Table11.xls, replace label dec(3) drop(num) nor2 stats(coef se) addstat(Adjusted R-squared,e(r2_a)) addtext(County*Year FE, Yes, Bank FE, No, Bank*State FE, Yes, Bank*Year FE, Yes) ctitle("Num-Return<10%")

capture drop spec_inddistress
gen spec_inddistress = aggIndNegShock_med_20

reghdfe f2num spec_above5pctemp spec_inddistress $controls ,absorb(county_year bank_state bank_year) cluster(fips)
outreg2 using Table11.xls, append label dec(3) drop(num) nor2 stats(coef se) addstat(Adjusted R-squared,e(r2_a)) addtext(County*Year FE, Yes, Bank FE, No, Bank*State FE, Yes, Bank*Year FE, Yes) ctitle("Num-Return<20%")

capture drop spec_inddistress
gen spec_inddistress = aggIndNegShock_med_30

reghdfe f2num spec_above5pctemp spec_inddistress $controls ,absorb(county_year bank_state bank_year) cluster(fips)
outreg2 using Table11.xls, append label dec(3) drop(num) nor2 stats(coef se) addstat(Adjusted R-squared,e(r2_a)) addtext(County*Year FE, Yes, Bank FE, No, Bank*State FE, Yes, Bank*Year FE, Yes) ctitle("Num-Return<30%")


*vol
capture drop spec_inddistress
gen spec_inddistress = aggIndNegShock_med_10

reghdfe f2volume spec_above5pctemp spec_inddistress $controls ,absorb(county_year bank_state bank_year) cluster(fips)
outreg2 using Table11.xls, append label dec(3) drop(num) nor2 stats(coef se) addstat(Adjusted R-squared,e(r2_a)) addtext(County*Year FE, Yes, Bank FE, No, Bank*State FE, Yes, Bank*Year FE, Yes) ctitle("Vol-Return<10%")

capture drop spec_inddistress
gen spec_inddistress = aggIndNegShock_med_20

reghdfe f2volume spec_above5pctemp spec_inddistress $controls ,absorb(county_year bank_state bank_year) cluster(fips)
outreg2 using Table11.xls, append label dec(3) drop(num) nor2 stats(coef se) addstat(Adjusted R-squared,e(r2_a)) addtext(County*Year FE, Yes, Bank FE, No, Bank*State FE, Yes, Bank*Year FE, Yes) ctitle("Vol-Return<20%")

capture drop spec_inddistress
gen spec_inddistress = aggIndNegShock_med_30

reghdfe f2volume spec_above5pctemp spec_inddistress $controls ,absorb(county_year bank_state bank_year) cluster(fips)
outreg2 using Table11.xls, append label dec(3) drop(num) nor2 stats(coef se) addstat(Adjusted R-squared,e(r2_a)) addtext(County*Year FE, Yes, Bank FE, No, Bank*State FE, Yes, Bank*Year FE, Yes) ctitle("Vol-Return<30%")

